﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Category
/// </summary>
public class CategoryBLL
{
    public int id { get; set; }
    public string name_cat { get; set; }
	public CategoryBLL()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public CategoryBLL(int id, string name_cat)
    {
        this.id = id;
        this.name_cat = name_cat;
    }
    public CategoryBLL(string name_cat)
    {
        this.name_cat = name_cat;
    }
    //get all category
    public List<CategoryBLL> getCategories()
    {
        return CategoryDAL.getCategory();
    }
    //
    public List<CategoryBLL> getCategories2()
    {
        return CategoryDAL.getCategory2();
    }
    public List<CategoryBLL> getCategoryInfo(int category_id)
    {
        return CategoryDAL.getCategoryInfo(category_id);
    }

    public bool addCategory(string name)
    {
        if (CategoryDAL.addCategory(name))
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public bool editCategory(int id, string name)
    {
        if (CategoryDAL.editCategory(id, name))
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public bool delCategory(int id, string name)
    {
        if (CategoryDAL.delCategory(id, name))
        {
            return true;
        }
        else
        {
            return false;
        }
    }
}